<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增人员信息')" />
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-data-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">收货人员：</label>
                <div class="col-sm-8">
                    <input name="personName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收货人员电话：</label>
                <div class="col-sm-8">
                    <input name="personTele" class="form-control" type="isPhone" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收货人微信号码：</label>
                <div class="col-sm-8">
                    <input name="personWeixin" class="form-control" type="text"  required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收货地址：</label>
                <div class="col-sm-8">
                    <input name="address" class="form-control" type="text" required>
                </div>
            </div>
            <div class="col-md-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">客服(管理人员)：</label>
                    <div class="col-sm-8">
                        <select id="userId" class="form-control" >
                            <option th:each="sysuser:${userList}" th:value="${sysuser.userId}" th:text="${sysuser.userName}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js"/>
    <th:block th:include="include :: bootstrap-select-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "system/data"
        $("#form-data-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var data = $("#form-data-add").serializeArray();
                var userId = $.form.selectSelects("userId");
                data.push({"name": "userId", "value": userId});
                $.operate.save(prefix + "/add",data);
            }
        }
    </script>
</body>
</html>